package baseCom.controller;

import baseCom.pojo.Emp;
import baseCom.pojo.Response;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Enumeration;
import java.util.List;

@RestController
public class hellloController {
    @RequestMapping("/hello")
    public String sayHello(HttpServletRequest request) {

        String headerValue = request.getHeader("Host");
        System.out.println("Header-Host Value: " + headerValue);

        Enumeration<String> parameterNames = request.getParameterNames();
        while (parameterNames.hasMoreElements()) {
            String paramName = parameterNames.nextElement();
            String paramValue = request.getParameter(paramName);
            System.out.println("Parameter Name: " + paramName + ", Value: " + paramValue);
        }
        String paramValue = request.getParameter("a");
        System.out.println("Parameter Value: " + paramValue);


        return "this is my local host response" + paramValue;
    }
}
